package com.palfund.uncaughtexceptionhandler;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Log.i("MainActivity", "---onCreate()--->getVersionCode   " + DeviceUtil.getVersionCode
                (this));
        Log.i("MainActivity", "---onCreate()--->getVersionName   " + DeviceUtil.getVersionName
                (this));
        Log.i("MainActivity", "---onCreate()--->getDeviceId   " + DeviceUtil.getDeviceId(this));
        Log.i("MainActivity", "---onCreate()--->getPhoneBrand   " + DeviceUtil.getPhoneBrand());
        Log.i("MainActivity", "---onCreate()--->getPhoneModel   " + DeviceUtil.getPhoneModel());
        Log.i("MainActivity", "---onCreate()--->getBuildLevel   " + DeviceUtil.getBuildLevel());
        Log.i("MainActivity", "---onCreate()--->getBuildVersion   " + DeviceUtil.getBuildVersion());
        Log.i("MainActivity", "---onCreate()--->getAppProcessId   " + DeviceUtil.getAppProcessId());
        Log.i("MainActivity", "---onCreate()--->getAppProcessName   " + DeviceUtil
                .getAppProcessName(this, DeviceUtil.getAppProcessId()));
        Log.i("MainActivity", "---onCreate()--->getMetaData   " + DeviceUtil.getMetaData(this,
                "1233"));
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        menu.add(Menu.NONE, 1, 1, "bug");
        return super.onCreateOptionsMenu(menu);

    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        float c = 1 / 0;
        return super.onOptionsItemSelected(item);
    }
}
